home *** CD-ROM | disk | FTP | other *** search
-
- /* amiga includes */
- #include <exec/memory.h>
- #include <dos/dostags.h>
- #include <workbench/startup.h>
- #include <workbench/workbench.h>
- #include <workbench/icon.h>
-
- /* amiga prototypes */
- #include <clib/dos_protos.h>
- #include <clib/exec_protos.h>
-
- /* amiga pragmas */
- #include <pragmas/dos_pragmas.h>
- #include <pragmas/exec_pragmas.h>
-
- /* PowerUP stuff */
- #include <PowerUP/PPCLib/Interface.h>
- #include <PowerUP/PPCLib/tasks.h>
- #include <PowerUP/PPCLib/ppc.h>
- #include <PowerUP/PPCLib/object.h>
- #include <PowerUP/PPCDisslib/PPCDiss.h>
- #include <PowerUP/clib/ppc_protos.h>
- #include <PowerUP/clib/ppcdiss_protos.h>
- #include <PowerUP/pragmas/ppcdiss_pragmas.h>
- #include <PowerUP/pragmas/ppc_pragmas.h>
-
- /* ANSI includes */
- #include <stdlib.h>
-
-
- extern struct Library *SysBase,
- *DOSBase;
- struct Library *PPCLibBase;
-
-
- int main( void )
- {
- if( PPCLibBase = OpenLibrary( "ppc.library", 45UL ) )
- {
- APTR ELFObject;
-
- extern char elfobject[];
- extern size_t elfobject_size;
-
- if( ELFObject = PPCLoadObjectTags( PPCELFLOADTAG_ELFADDRESS, (ULONG)elfobject,
- PPCELFLOADTAG_ELFLENGTH, (ULONG)elfobject_size,
- TAG_DONE ) )
- {
- struct TagItem MyTags[ 9 ];
- ULONG Result;
-
- MyTags[ 0 ] . ti_Tag = PPCTASKTAG_STOPTASK;
- MyTags[ 0 ] . ti_Data = FALSE;
- MyTags[ 1 ] . ti_Tag = PPCTASKTAG_WAITFINISH;
- MyTags[ 1 ] . ti_Data = TRUE;
- MyTags[ 2 ] . ti_Tag = PPCTASKTAG_INPUTHANDLE;
- MyTags[ 2 ] . ti_Data = (ULONG) Input();
- MyTags[ 3 ] . ti_Tag = PPCTASKTAG_OUTPUTHANDLE;
- MyTags[ 3 ] . ti_Data = (ULONG) Output();
- MyTags[ 4 ] . ti_Tag = PPCTASKTAG_STACKSIZE;
- MyTags[ 4 ] . ti_Data = 0x10000;
- MyTags[ 5 ] . ti_Tag = NP_CloseInput;
- MyTags[ 5 ] . ti_Data = FALSE;
- MyTags[ 6 ] . ti_Tag = NP_CloseOutput;
- MyTags[ 6 ] . ti_Data = FALSE;
- MyTags[ 7 ] . ti_Tag = PPCTASKTAG_BREAKSIGNAL;
- MyTags[ 7 ] . ti_Data = TRUE;
- MyTags[ 8 ] . ti_Tag = TAG_DONE;
- MyTags[ 8 ] . ti_Data = 0UL;
-
- Result = (ULONG)PPCCreateTask( ELFObject, &MyTags[ 0 ] );
-
- PPCUnLoadObject( ELFObject );
- }
-
- CloseLibrary( PPCLibBase );
- }
-
- return( RETURN_OK );
- }
-
-
-